﻿using AutoMapper;
using BW.MesProject.Equipment.Domain.Equipment;
using BW.MesProject.Equipment.Infrastructure.Dto.Input.DeviceLedger;
using BW.MesProject.Equipment.Infrastructure.Dto.Input.DeviceType;
using BW.MesProject.Equipment.Infrastructure.Dto.Input.ProjectForm;
using BW.MesProject.Equipment.Infrastructure.Dto.Input.ProjectMaintenance;
using BW.MesProject.Equipment.Infrastructure.Dto.Output.DeviceLedger;
using BW.MesProject.Equipment.Infrastructure.Dto.Output.DeviceType;
using BW.MesProject.Equipment.Infrastructure.Dto.Output.ProjectFrom;
using BW.MesProject.Equipment.Infrastructure.Dto.Output.ProjectMaintenance;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BW.MesProject.Equipment.Application
{
    /// <summary>
    /// AutoMapper 配置文件，用于定义对象之间的映射关系
    /// </summary>
    public class AutoMapperFiles : Profile
    {
        /// <summary>
        /// 构造函数，配置实体与DTO的映射关系
        /// </summary>
        public AutoMapperFiles()
        {
            //设备类型
            CreateMap<AddDeviceTypeInput, DeviceTypeModel>();
            CreateMap<DeviceTypeModel, DeviceTypeOutput>();
            //设备台账
            CreateMap<AddDeviceLedgerInput, DeviceLedgerModel>();
            CreateMap<UpdateDeviceLedgerInput, DeviceLedgerModel>();
            CreateMap<DeviceLedgerModel, DeviceLedgerOutput>();

            //项目维护
            CreateMap<AddProjectMaintenanceInput, ProjectMaintenanceModel>();
            CreateMap<ProjectMaintenanceModel, ProjectMaintenanceOutput>();
            CreateMap<UpdateProjectMaintenanceInput, ProjectMaintenanceModel>();

            //项目表单
            CreateMap<AddProjectFormInput, ProjectFromModel>();
            CreateMap<ProjectFromModel, ProjectFromOutput>();
            CreateMap<UpdateProjectFormInput, ProjectFromModel>();
        }
    }
}
